package appli;

import java.io.File;
import java.io.RandomAccessFile;

import org.apache.log4j.xml.DOMConfigurator;
import org.jaudiotagger.audio.AudioFileIO;
import org.jaudiotagger.audio.mp3.MP3File;
import org.jaudiotagger.tag.id3.ID3v24Tag;


public class Test {

	public static void main(String[] args) throws Exception {

		DOMConfigurator.configure("log4j.xml");

		//System.getProperties().put("http.proxyHost", "wwwsddc.galeries");
		//System.getProperties().put("http.proxyPort", "3128");
		//Authenticator.setDefault(new httpAuthProxy());
		// System.getProperties().put("http.proxyUser", "rRetek");
		// System.getProperties().put("http.proxyPassword", "7yaoch");

		// java.util.logging.Logger.getLogger("org.jaudiotagger.audio").setLevel(java.util.logging.Level.SEVERE);
		// java.util.logging.Logger.getLogger("org.jaudiotagger.tag.id3").setLevel(java.util.logging.Level.SEVERE);
		// java.util.logging.Logger.getLogger("org.jaudiotagger.audio").getParent().setLevel(java.util.logging.Level.SEVERE);
		// System.out.println(java.util.logging.Logger.getLogger("org.jaudiotagger.audio").getName());
		// System.out.println(java.util.logging.Logger.getLogger("org.jaudiotagger.audio").getParent().getName());
		// java.util.logging.Logger.getAnonymousLogger().getParent().setLevel(
		// java.util.logging.Level.SEVERE);
		// AudioFile f = AudioFileIO.read(new File(
		// "E:/ELUVEITIE - 2000 Spirit/ELUVEITIE - 11 - 11 - Andro.mp3"));
		// Tag tag = f.getTag();
		// AudioHeader ah = f.getAudioHeader();

		//MetalArchivesServices mas = MetalArchivesServicesImpl.getInstance();
		//MAArtisteBean ab = mas.getArtiste(3540256792L);
		// for (int i=0;i<ab.getReleases().size();i++) {
		// System.out.println(i+" "+ab.getReleases().get(i));
		// }
		//MetalArchivesDAO mad = MetalArchivesDAOImpl.getInstance();
		//mad.ajouter(ab);
		//mas.getTracks(ab.getReleases().get(0));
		//mad.ajouter(ab);
		//mas.getLyrics(new TrackMABean());
		
		//URL url = new URL("http://www.metal-archives.com/images/1/0/0/6/10068_logo.jpg");
		//ActionsFichiers.copierFichier(url, new File("c:/toto.jpg"));
		
		//ID3v1Tag tag = new ID3v1Tag();
		//tag.delete(new RandomAccessFile(new File("e:/ELUVEITIE - 2000 Spirit/ELUVEITIE - 01 - 01 Spirit.mp3"), "rw"));
		
		/*RandomAccessFile imageFile = new RandomAccessFile(new File("e:/ELUVEITIE - 2000 Spirit/105454.JPG"), "r");
		MP3File f = (MP3File) AudioFileIO.read(new File("e:/ELUVEITIE - 2000 Spirit/ELUVEITIE - 01 - 01 Spirit.mp3"));
		ID3v24Tag tag = f.getID3v2TagAsv24();
		byte[] imagedata = new byte[(int) imageFile.length()];
		imageFile.read(imagedata);
		tag.add(tag.createArtworkField(imagedata,"image/jpeg"));
		f.commit();*/

		String url = "http://lldk/kdkfds/kjksdf.gif";
		System.out.println(url);
		System.out.println(url.substring(url.lastIndexOf('.')));
		
	}
}